# -*- coding: utf-8 -*-

"""
@date: 2020/10/7 下午4:17
@file: slowfast_config.py
@author: zj
@description: 
"""

from yacs.config import CfgNode as CN


def add_custom_config(_C):
    _C.MODEL.BACKBONE.TYPE = 'SlowOnly'
    _C.MODEL.BACKBONE.LATERAL = False
    _C.MODEL.BACKBONE.SPEED_RATIO = 8
    _C.MODEL.BACKBONE.CHANNEL_RATIO = 8
    _C.MODEL.BACKBONE.FUSION_KERNEL = 5
    _C.MODEL.BACKBONE.RESAMPLE_RATE = 8

    _C.MODEL.BACKBONE.SLOW_PATHWAY = CN()
    _C.MODEL.BACKBONE.SLOW_PATHWAY.IN_CHANNELS = 3
    _C.MODEL.BACKBONE.SLOW_PATHWAY.SPATIAL_STRIDES = (1, 2, 2, 2)
    _C.MODEL.BACKBONE.SLOW_PATHWAY.TEMPORAL_STRIDES = (1, 1, 1, 1)
    _C.MODEL.BACKBONE.SLOW_PATHWAY.DILATIONS = (1, 1, 1, 1)
    _C.MODEL.BACKBONE.SLOW_PATHWAY.BASE_CHANNEL = 64
    _C.MODEL.BACKBONE.SLOW_PATHWAY.CONV1_KERNEL = (1, 7, 7)
    _C.MODEL.BACKBONE.SLOW_PATHWAY.CONV1_STRIDE_T = 1
    _C.MODEL.BACKBONE.SLOW_PATHWAY.POOL1_KERNEL_T = 1
    _C.MODEL.BACKBONE.SLOW_PATHWAY.POOL1_STRIDE_T = 1
    _C.MODEL.BACKBONE.SLOW_PATHWAY.WITH_POOL2 = False
    _C.MODEL.BACKBONE.SLOW_PATHWAY.INFLATES = (0, 0, 1, 1)
    _C.MODEL.BACKBONE.SLOW_PATHWAY.INFLATE_STYLE = '3x1x1'
    _C.MODEL.BACKBONE.SLOW_PATHWAY.NON_LOCAL = (0, 0, 0, 0)

    _C.MODEL.BACKBONE.FAST_PATHWAY = CN()
    _C.MODEL.BACKBONE.FAST_PATHWAY.IN_CHANNELS = 3
    _C.MODEL.BACKBONE.FAST_PATHWAY.SPATIAL_STRIDES = (1, 2, 2, 2)
    _C.MODEL.BACKBONE.FAST_PATHWAY.TEMPORAL_STRIDES = (1, 1, 1, 1)
    _C.MODEL.BACKBONE.FAST_PATHWAY.DILATIONS = (1, 1, 1, 1)
    _C.MODEL.BACKBONE.FAST_PATHWAY.BASE_CHANNEL = 8
    _C.MODEL.BACKBONE.FAST_PATHWAY.CONV1_KERNEL = (5, 7, 7)
    _C.MODEL.BACKBONE.FAST_PATHWAY.CONV1_STRIDE_T = 1
    _C.MODEL.BACKBONE.FAST_PATHWAY.POOL1_KERNEL_T = 1
    _C.MODEL.BACKBONE.FAST_PATHWAY.POOL1_STRIDE_T = 1
    _C.MODEL.BACKBONE.FAST_PATHWAY.WITH_POOL2 = False
    _C.MODEL.BACKBONE.FAST_PATHWAY.INFLATES = (1, 1, 1, 1)
    _C.MODEL.BACKBONE.FAST_PATHWAY.INFLATE_STYLE = '3x1x1'
    _C.MODEL.BACKBONE.FAST_PATHWAY.NON_LOCAL = (0, 0, 0, 0)
